import json


def save_json(data, json_path):
    with open(json_path, "w") as f:
        json.dump(data, f, ensure_ascii=False, indent=4)


with open("/data/nvme2/ws/DFBenchmark/data/DFBenchmark.json", "r") as f:
    data = json.load(f)


filter_keys = ["result", "check", "output", "cot"]
for item in data:
    for k in filter_keys:
        if k in item:
            del item[k]
sorted_data = sorted(data, key=lambda x: x["id"])
save_json(sorted_data, "/data/nvme2/ws/DFBenchmark/data/DFBenchmark_1.json")
